package com.Threecharacters.Poly_.Polyparameter.Case;

public class Test {

    public static void main(String[] args) {
        Master master = new Master("Tom");
        Dog dog = new Dog("小白");
        Bone bone = new Bone("排骨");
        //方法定义的形参类型为父类类型，实参允许为子类类型。体现了多态
        //下面这行代码就是一个很好的例子
        master.feed(dog,bone);

        Cat cat = new Cat("Kite");
        Fish fish = new Fish("草鱼");
        master.feed(cat,fish);

        Pig pig = new Pig("佩奇");
        Rice rice = new Rice("糙米");
        master.feed(pig,rice);




    }


}
